<template>
  <div class="pdf-viewer">
    <iframe :src="src+'#toolbar=0'" style="width: 100%; height:100%" />
  </div>
</template>

<script>
export default {
  name: 'sxc-pdf-viewer',
  props: ['pdfurl'],
  data () {
    return {
      
    }
  },
  computed: {
    src () {
      const { pdfurl } = this
      if (pdfurl.indexOf('.pdf') !== -1) {
        return pdfurl
      } else {
        return `http://view.officeapps.live.com/op/view.aspx?src=${pdfurl}`
      }
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.pdf-viewer {
  width: 100%;
  height: 100%;
}
</style>
